/******************************************************************************
 * Filename : uc_com.h
 * Copyright: 
 * Created  : 2011-1-6 by franco.yin
 * Description -
 * 
 ******************************************************************************/

#ifndef _UC_COM_H
#define _UC_COM_H

#ifdef __cplusplus
extern "C" {
#endif

#include "uc_public.h"
#include "uc_time.h"

extern int uccom_open(char *pDev, int app_com_index);
extern void uccom_close(int com_index, int com_fd);
extern int uccom_open_ext(char *dev, void **ppHandle);
extern void uccom_close_ext(void *pHandle, int com_fd);
extern int uccom_set_speed(int fd, int speed);
extern int uccom_set_parity(int fd, int databits, int stopbits, int parity);
extern int uccom_flush(int fd);
extern int uccom_write(int fd, char *pBuf, int buf_len);
extern int uccom_read(int fd, char *pBuf, int buf_size, int timeout_ms);

#ifdef __cplusplus
}
#endif

#endif
